﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Drawing;

namespace YLServerInterface.UserControls
{
    /// <summary>
    /// Interaction logic for ImageCutterWrapper.xaml
    /// </summary>
    public partial class ImageCutterWrapper : UserControl
    {
        public ImageCutterWrapper()
        {
            InitializeComponent();

        }
        public string ImgPath { get; set; }
        public string SaveImgPath { get; set; }
        public double RectWidth { get; set; }
        public double RectHeight { get; set; }

        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            imageCutter1.ImgPath = this.ImgPath;
            imageCutter1.SaveImgPath = this.SaveImgPath;
            imageCutter1.RectWidth = this.RectWidth;
            imageCutter1.RectHeight = this.RectHeight;
            Bitmap bitmap = new Bitmap(ImgPath);
            labResolution.Content = "分辨率：" + bitmap.Width + " X " + bitmap.Height;
            bitmap.Dispose();
        }
    }
}
